import { AbstractSearchArgument } from '../../global'
import { CONDITION_TYPE } from '../../../utils/constants'

const SEARCH_CONDITION = [
  {
    name: 'title',
    title: '标题',
    placeholder: '支持模糊查询',
    type: CONDITION_TYPE.TEXT,
    value: '',
    visible: true
  },
  {
    name: 'senderName',
    title: '发放者姓名',
    placeholder: '请填写完整姓名',
    type: CONDITION_TYPE.TEXT,
    value: '',
    visible: true
  },
  {
    name: 'province',
    title: '省份',
    placeholder: '支持模糊查询',
    type: CONDITION_TYPE.TEXT,
    value: '',
    visible: false
  },
  {
    name: 'city',
    title: '城市',
    placeholder: '支持模糊查询',
    type: CONDITION_TYPE.TEXT,
    value: '',
    visible: false
  },
  {
    name: 'orderBy',
    title: '排序',
    placeholder: '--请选择排序--',
    type: CONDITION_TYPE.SELECT,
    value: '',
    visible: true,
    config: {
      list: [
        {value: 1, label: '按访问量倒序'},
        {value: 2, label: '按填写时长倒序'},
        {value: 3, label: '按省市顺序'},
        {value: 4, label: '按填写者号码倒序'}
      ]
    }
  }
]

class SearchArgument extends AbstractSearchArgument {
  constructor () {
    super()

    this.title = ''
    this.senderName = ''
    this.province = ''
    this.city = ''
    this.orderBy = ''
  }
}

export {
  SEARCH_CONDITION,
  SearchArgument
}
